/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package com.plian.system.entity.hr.dept;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.plian.Tools.DateUtil;
import com.plian.system.mybatis.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 部门基础信息实体类
 *
 * @author gangan
 * @since 2019-08-07
 */
@Data
@TableName("hr_dept")
@EqualsAndHashCode(callSuper = true)
public class Dept extends BaseEntity {

	private static final long serialVersionUID = 1L;

	/**
	* 部门编码
	*/
	@ApiModelProperty(value = "部门编码", required = true)
		private String deptCode;
	/**
	* 部门名称
	*/
	@ApiModelProperty(value = "部门名称", required = true)
		private String deptName;
	/**
	* 上级部门
	*/

	@JsonSerialize(using = ToStringSerializer.class)
	@ApiModelProperty(value = "上级部门id")
		private Long deptHigherId;
	/**
	* 部门负责人
	*/
	@JsonSerialize(using = ToStringSerializer.class)
	@ApiModelProperty(value = "部门负责人id")
		private Long deptHead;
	/**
	* 所属单位
	*/
	@ApiModelProperty(value = "所属单位id")
		private String deptAffiliation;
	/**
	* 启用/停用 1启用 2停用
	*/
	@ApiModelProperty(value = " 启用/停用 1启用 2停用", required = true)
		private Integer deptEnableDisable;
	/**
	* 停用时间
	*/
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME, timezone = "Asia/Shanghai")
	@TableField(value = "dept_deactivation_time",updateStrategy = FieldStrategy.IGNORED)
	@ApiModelProperty(value = "上级部门名称")
		private Date deptDeactivationTime;
	/**
	* 备注
	*/
	@ApiModelProperty(value = "上级部门名称")
		private String remark;
	/**
	* 版本号
	*/
		private String versionNumber;
	/**
	* 乐观锁字段
	*/
		private Integer tsVersion;

		private String formType;

	/**
	 * 数据来源 null为系统填报 对应用户id
	 */
	@ApiModelProperty(value = "数据来源 null为系统填报 对应用户id")
	private String dataSource;

	/**
	 * 数据来源id
	 */
	@ApiModelProperty(value = "数据来源id", required = true)
	private String dataSourceId;
}
